package com.laputa.system.strategy.impl;

import com.laputa.system.Lib;
import com.laputa.system.element.BuildingElement;
import com.laputa.system.strategy.BuildingConstructor;

public class BuildingConstructorImpl implements BuildingConstructor {
	
	private BuildingElement buildingElement;
	
	public void setBuildingElement(BuildingElement buildingElement){
		this.buildingElement = buildingElement;
	}
	
	public BuildingElement construct(Long type) {
		long layer = Lib.random(100);
		long pop = 2*layer;		
		this.buildingElement.setTotalLayer(layer);
		this.buildingElement.setPopulation(pop);
		this.buildingElement.setType(type);
		return this.buildingElement;
	}

}
